export
const password = {
  regex: /^(?=.*[0-9])(?=.*[A-Za-z]).{8,20}$/,
  test: val => this.regex.test(val),
  msg: '8~20位，同时包含英文字母和数字'
}

export
const email = {
  regex: /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,
  test: val => this.regex.test(val),
  msg: '邮箱格式有误'
}

export
const emailAddress = email

export
const citizenId = {
  regex: /^(\d{15})$|(\d{17}[\dX])$/,
  test: val => this.regex.test(val),
  msg: '身份证号码格式有误'
}

export
const mobilePhone = {
  regex: /^1\d{10}$/,
  test: val => this.regex.test(val),
  msg: '请输入11位有效手机号'
}

export
const sqStaffMobilePhone = mobilePhone

export default {
  password,
  email,
  emailAddress,
  citizenId,
  mobilePhone,
  sqStaffMobilePhone
}
